﻿using UnityEngine;
using System.Collections;

public class CreatAlien : MonoBehaviour {

	public int  aa = 1;

	public  GameObject  PrefabsIn;
	public  GameObject []Trans1=new GameObject[40]  ;

	// Use this for initialization
	void Start () {
		int Counter;
		print ("Pre  satart!!!");
		int x, y;
		for(Counter=0,x=0;x<3;x++)
		{
			for(y=0;y<3;y++)
			{	
				#if   false
				Trans1[Counter]=PrefabsIn;
			
				Trans1[Counter]	=(GameObject)Instantiate (Trans1[Counter], transform.position,transform.rotation);
				Trans1[Counter].transform.localPosition=new Vector3(x, y, 1);
				Counter++;
				#else
				
				PrefabsIn	=(GameObject)Instantiate (PrefabsIn, transform.position,transform.rotation);
				PrefabsIn.transform.localPosition=new Vector3(x, y, 1);

				#endif
				//Trans1.transform.localScale=Vector2(0.8,0.8);
				//Trans1.transform.position=new Vector3(x,y,1);
			}
		}
		print ("一共"+Counter);
		//Destroy (Trans1);
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	void  OnGUI()
	{

	}

}
